<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/extremecomponents.tld" prefix="ec" %>
<%@ taglib uri="/WEB-INF/authz" prefix="auth"%>

<!-- Init menu de acciones de operador -->
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<META HTTP-EQUIV="Expires" CONTENT="-1">
		<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<META HTTP-EQUIV="Expires" CONTENT="-1">

		<link href="<%=request.getContextPath()%>/css/general.css" rel="stylesheet" type="text/css" />
		<link href="<%=request.getContextPath()%>/css/defaultForm.css" rel="stylesheet" type="text/css" />
		<link href="<%=request.getContextPath()%>/css/extremecomponents.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/message.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/formUtilit.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/appletClass.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/certificatesToken.js"></script>		
		
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/ajax.js"></script>		
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/tab.js"></script>		
		<script type="text/javascript" src="<%=request.getContextPath()%>/js/rico/rico.js"></script>		
		<title><tiles:getAsString name="title"/></title>
			<script type="text/javascript">
		
		// Messages and buttons
		var missingFieldsMessage = "<bean:message key="error.missingFields"/>";
		var onlyNumberFieldsMessage = "<bean:message key="error.onlyNumberFields"/>";
		var emailFieldsMessage = "<bean:message key="error.emailFields"/>";
		var dateFieldsMessage = "<bean:message key="error.dateFields"/>";
		var generalFillFieldsMessage = "<bean:message key="error.generalFillFields"/>";
		var buttonOk = "<bean:message key="button.ok"/>";
		var buttonCancel = "<bean:message key="button.cancel"/>";
		var buttonYes = "<bean:message key="button.yes"/>";
		var buttonNo = "<bean:message key="button.no"/>";

</script>
	</head>


<link href="css/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/dhtmlgoodies_calendar.js"></script>

<div class="main">
	
	<div style="margin:0;padding:0;clear:both;">
		<a href="abmPdi.do?method=formListoUnidades" class="tab unselectedTab" onclick="this.blur();"><span>Unidades</span></a>
		<a href="abmPdi.do?method=preparedSelectProceso" class="tab unselectedTab" onclick="this.blur();"><span>Inventario</span></a>
		<a href="abmPdi.do?method=preparedSelectParamPeriodo" class="tab currentTab" onclick="this.blur();"><span>Reportes por Periodo</span></a>
		<a href="abmPdi.do?method=preparedSelectParamPd0018cl" class="tab unselectedTab" onclick="this.blur();"><span>Reportes por Proceso</span></a>		
	</div>
	
	<div class="panel_100 tab">
		
		<fieldset class="defaultFieldset" id="field_Reportes" >
			<legend>Reportes por periodo</legend>
			
			<html:form target="listPrefacturacionFrame" action="/abmPdi.do?method=preparedListoReportesPeriodo" styleId="listPrefacturacionForm">
				<table cellspacing="">
				<tr>
				<td>
				<label style="margin-top: 4px;" for="cbReporte"><jsp:include page="../add_on/asterix.jsp"/>Reporte:</label>
				<html:select style="margin-top: 2px;" property="reporte.idReporte" styleId="cbReporte" >
					<html:optionsCollection property="reporteList" name="abmPdiForm" label="nombre" value="idReporte" />
				</html:select>
				</td>

				<td>
				<h>&nbsp&nbsp</h>
				<label for="dateDesde"><jsp:include page="../add_on/asterix.jsp"/>Desde:</label>
				<html:text name="abmPdiForm" property="dateDesde" styleId="fechaDesde" readonly="true"/>
           		<label style="margin-top:0;"><img src="images/general/cal.gif" style="cursor:pointer;" onclick="displayCalendar(document.getElementById('fechaDesde'),'dd/mm/yyyy',this)"/></label>				
				</td>
				
				<td>
				<h>&nbsp&nbsp</h>
				<label  for="dateHasta"><jsp:include page="../add_on/asterix.jsp"/>Hasta:</label>
				<html:text name="abmPdiForm" property="dateHasta" styleId="fechaHasta" readonly="true"/>
           		<label style="margin-top:0;"><img src="images/general/cal.gif" style="cursor:pointer;" onclick="displayCalendar(document.getElementById('fechaHasta'),'dd/mm/yyyy',this)"/></label>				
				<h>&nbsp&nbsp</h>
				</td>
				
				<td>
				
					<html:link href="#" styleClass="button" style="margin: 0px;" onclick="submitForm('listPrefacturacionForm');"><span>Aceptar</span></html:link>
				
				</td>
				</tr>
				</table>
			</html:form>
	
			<div class="space"></div>
			
			<iframe id="listPrefacturacionFrame" name="listPrefacturacionFrame" style="width: 100%;height: 950px; display: none; background-color:#eeeeee;" frameborder="1" src="<html:rewrite page="/pages/add_on/cargando.jsp"/>" ></iframe>
			
			<div class="space"></div>
		</fieldset>

		<div class="space"></div>
	</div>
</div>

<script language="javascript">
function submitForm(formId) { 
	prepareReportFrame();
	document.getElementById(formId).submit();
}

function prepareReportFrame( ) {
	var reportFrame = document.getElementById('listPrefacturacionFrame');
	reportFrame.style.display = "inline";
}
</script> 
